package com.xhsj.user.hr.process.processDefinition.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.Lists;
import com.xhsj.user.hr.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 流程-历史表
 * </p>
 *
 * @author liuqinghua
 * @since 2020-08-31
 */
@Data
@Accessors(chain = true)
@TableName("tb_global_approval_hi_task")
public class TbGlobalApprovalHiTask{

    private static final long serialVersionUID = 1L;
    //	@TableField(exist = false)
    @JsonIgnore
    protected static int currentPage;
    //	@TableField(exist = false)
    @JsonIgnore
    protected static int pageSize;

    //排序列表
    @JsonIgnore
    @TableField(exist = false)
    private List<Map<String,String>> orderBy = Lists.newArrayList();

    /**
     * 自增id
     */
    @TableField("id")
    protected Long id;

    /**
     * 创建人
     */
    @TableField("create_by")
    protected Long createBy;

    /**
     * 创建人姓名
     */
//    @TableField("create_name")
//    protected String createName;
    /**
     * 创建时间
     */
    @TableField("create_date")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    protected Date createDate;
    /**
     * 修改人
     */
    @TableField("update_by")
    protected Long updateBy;

    /**
     * 修改人姓名
     */
//    @TableField("update_name")
//    protected String updateName;
    /**
     * 修改时间
     */
    @TableField("update_date")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    protected Date updateDate;
    /**
     * 删除标记
     */
    @TableField(value = "del_flag")
    @TableLogic //表字段逻辑处理注解（逻辑删除）
    protected int delFlag = 0;
    /**
     * 备注
     */
    @TableField("remarks")
    protected String remarks;

    /**
     * 流程id 外键  tb_global_business id
     */
    @TableField("business_id")
    private Long businessId;

    /**
     * 业务数据id
     */
    @TableField("data_id")
    private Long dataId;

    /**
     * 节点id
     */
    @TableField("node_id")
    private Long nodeId;

    /**
     * 审核人id
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 审核人角色id
     */
    @TableField("role_id")
    private Long roleId;

    /**
     * 审核状态 0审核通过 1审核退回 2未审核
     */
    @TableField("status")
    private Integer status;

    /**
     * 审核用户名
     */
    @TableField("handler")
    private String handler;

    /**
     * 审批意见
     */
    @TableField("opinion_text")
    private String opinionText;

    /**
     * 节点名称
     */
    @TableField("node_name")
    private String nodeName;

    public TbGlobalApprovalHiTask() {
    }

    public TbGlobalApprovalHiTask(Long businessId, Long dataId, Long nodeId, Integer status,String nodeName,Long createBy,Date createDate,Long updateBy,Date updateDate) {
        this.businessId = businessId;
        this.dataId = dataId;
        this.nodeId = nodeId;
        this.status = status;
        this.nodeName = nodeName;
        this.createBy = createBy;
        this.createDate = createDate;
        this.updateBy = updateBy;
        this.updateDate = updateDate;
    }
}
